/********************************************************************************
 *      Copyright:  (C) 2022 ZYT
 *                  All rights reserved.
 *
 *       Filename:  client_func.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(28/03/25)
 *         Author:  Zhang yuting <zhangyuting@163.com>
 *      ChangeLog:  1, Release initial version on "28/03/25 03:59:59"
 *                 
 ********************************************************************************/

#ifndef _CLIENT_FUNC_H_
#define _CLIENT_FUNC_H_

#include <stdio.h>
#include <time.h>
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <sys/stat.h> 
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <fcntl.h>
#include <unistd.h>


#include "logger.h"

#define PID_SIZE        11

#define CONFIG_DEBUG
#ifdef CONFIG_DEBUG
#define dbg_printf(format, args...) printf(format, ##args)
#else
#define dbg_printf(format, args...) do{} while(0)
#endif

void print_usage(char *progname);
int get_time(char *gettime);
char * get_format_time(long current_time);
int set_background_running(int daemon_flag, char *pidfile);
int check_background_running(char *pidfile);
pid_t get_daemon_pid(char *pidfile);
int record_daemon_pid(char *pidfile);
int stop_background_running(char *pidfile);

#endif
